package com.glory.cqaospda.viewmodel

import com.glory.cqaospda.model.TaskRepository
import com.glory.mvvmnet.base.BaseViewModel
import com.glory.mvvmnet.entity.CallObserveBean
import com.google.gson.JsonObject

class QueryRepairInfoModel:BaseViewModel() {

    private val repository by lazy { TaskRepository() }

    fun defaultQueryRepairInfo(eqpID: String) {
        val map = JsonObject()
        map.addProperty("EquipmentName", eqpID)
        launchWithError({
            val defaultQueryRepairInfo =
                repository.defaultQueryRepairInfo(map,"EMS_QueryRepairInfo")
            defUI.callObserve.value = CallObserveBean(1,defaultQueryRepairInfo)
        },{

            defUI.callObserve.value = CallObserveBean(2)
        })
    }
}